home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 688 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.0 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Mon, 6 Dec 93 11:20:09 +0100
  3. Message-Id: <9312061020.AA00631@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. Subject: MiNT 1.09: Bug in Fselect
  6.  
  7. Fselect does not work correctly if identical pointers gets passed,
  8. for example:
  9.  
  10. int fds = 1;
  11. Fselect (0, &fds, &fds, 0);
  12.  
  13. fds is cleared before it is read the second time (via *wfdp).
  14.  
  15. Of course, this is not very usefull, but configure from the screen
  16. package depends on it.
  17.  
  18. --- orig/dosfile.c    Mon Aug  2 19:00:44 1993
  19. +++ dosfile.c    Sat Dec  4 17:32:46 1993
  20. @@ -965,19 +965,21 @@
  21.      TIMEOUT *t;
  22.      short sr;
  23.  
  24. -    if (xfdp)
  25. -        *xfdp = 0;
  26. -
  27.      if (rfdp) {
  28. -        rfd = *rfdp; *rfdp = 0;
  29. +        rfd = *rfdp;
  30.      }
  31.      else
  32.          rfd = 0;
  33.      if (wfdp) {
  34. -        wfd = *wfdp; *wfdp = 0;
  35. +        wfd = *wfdp;
  36.      }
  37.      else
  38.          wfd = 0;
  39. +
  40. +    /* Watch out for aliasing */
  41. +    if (rfdp) *rfdp = 0;
  42. +    if (wfdp) *wfdp = 0;
  43. +    if (xfdp) *xfdp = 0;
  44.  
  45.      TRACE(("Fselect(%u, %lx, %lx)", timeout, rfd, wfd));
  46.      p = curproc;            /* help the optimizer out */
  47.